package com.jinshan.statistics.controller;


import com.jinshan.response.RetVal;
import com.jinshan.statistics.service.DailyStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 网站统计日数据 前端控制器
 * </p>
 *
 * @author Jinshan
 * @since 2020-06-30
 */
@RestController
@RequestMapping("/daily/statistics")
@CrossOrigin
public class DailyStatisticsController {
    @Autowired
    private DailyStatisticsService statisticsService;

    @PostMapping("generateStatistic/{date}")
    public RetVal generateStatistic(@PathVariable String date) {
        statisticsService.generateStatistic(date);
        return RetVal.success();
    }
}

